#!/usr/bin/python 
#   yongming.li

import re
import string
import os
import time
import  sys


cmds=[#'adb shell top -d 1 -n 1',
      'adb shell cat /proc/stat',
      'adb shell cat /proc/meminfo',
      'adb shell ps',
      'adb shell cat /proc/stat']
def takescreenshot():
    cmd = 'adb shell /system/bin/screencap  /data/xmeter.png'
    print cmd
    os.popen(cmd)
    cmd = 'adb pull  /data/xmeter.png  ./screencap/xmeter.png'
    print cmd
    os.popen(cmd)
     
def startParseException():
    while True:
        cmdsize= len(cmds)
        for index in range(0,cmdsize):
            run(cmds[index],index);   
        batteryMonitor.start()
        memMonitor.start()
        #os.system('cp -rf ./out/ ./out_show')
        takescreenshot()
        time.sleep(1)


def help():
    helpInfo = """
Build Environment Requirement
=============================================================
* ********* Suggested OS and Tool Chain to install *********
*
*       OS                         : Linux distribution Ubuntu 10.04
*       Memory Size                : 4G or above
*       make                       : GNU Make 3.81 or 3.82
*       python                     : Version 2.6.X
*       pyqt                       : 4.0
*       directchart                 :  ***
* **********************************************************
=============================================================
"""
if __name__ == '__main__':
    startParseException()
version =  '0.2'  


